﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x0200042C RID: 1068
	[DisallowMultipleComponent]
	public class ObservableDeselectTrigger : ObservableTriggerBase, IEventSystemHandler, IDeselectHandler
	{
		// Token: 0x0600164C RID: 5708 RVA: 0x0006155B File Offset: 0x0005F95B
		void IDeselectHandler.OnDeselect(BaseEventData eventData)
		{
			if (this.onDeselect != null)
			{
				this.onDeselect.OnNext(eventData);
			}
		}

		// Token: 0x0600164D RID: 5709 RVA: 0x00061574 File Offset: 0x0005F974
		public IObservable<BaseEventData> OnDeselectAsObservable()
		{
			Subject<BaseEventData> result;
			if ((result = this.onDeselect) == null)
			{
				result = (this.onDeselect = new Subject<BaseEventData>());
			}
			return result;
		}

		// Token: 0x0600164E RID: 5710 RVA: 0x0006159C File Offset: 0x0005F99C
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onDeselect != null)
			{
				this.onDeselect.OnCompleted();
			}
		}

		// Token: 0x04000C91 RID: 3217
		private Subject<BaseEventData> onDeselect;
	}
}
